<template>
  <div class="header" fixed="true">
    <Header :title="title">
      <router-link v-if="search" :to="{path:'/search'}" slot="left">搜索</router-link>
      <router-link v-if="!userInfo._id && login" :to="userInfo._id?'/userinfo':'/login'" slot="right">登录|注册</router-link>
    </Header>
  </div>
</template>

<script>
import { Header } from 'mint-ui'

import { mapState } from 'vuex'

export default {
  props: [ 'title', 'search', 'login' ],
  components: {
    Header
  },
  computed: {
    ...mapState(['userInfo'])
  }
}
</script>

<style lang="stylus" rel="stylesheet/stylus">
.mint-header
  height 45px;
.mint-header-title
  font-size 18px
</style>
